package me.yushuai.wukong.base.convertor;

import me.yushuai.wukong.base.api.dto.CreatePackingDTO;
import me.yushuai.wukong.base.api.dto.PackingUomDTO;
import me.yushuai.wukong.base.api.dto.UpdatePackingDTO;
import me.yushuai.wukong.base.entity.PackingUom;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;

/**
 * 包规单位转换器
 *
 * @author zhoushuai@189.cn
 * @since 2022-11-22
 */
@Mapper(componentModel = "spring")
public interface PackingUomConvertor {

    @Mapping(target = "widthUom", ignore = true)
    @Mapping(target = "weightUom", ignore = true)
    @Mapping(target = "uomId", ignore = true)
    @Mapping(target = "rplLabel", ignore = true)
    @Mapping(target = "qty", ignore = true)
    @Mapping(target = "packMaterial", ignore = true)
    @Mapping(target = "outLabel", ignore = true)
    @Mapping(target = "lengthUom", ignore = true)
    @Mapping(target = "inLabel", ignore = true)
    @Mapping(target = "heightUom", ignore = true)
    @Mapping(target = "cubeUom", ignore = true)
    @Mapping(target = "cartonizeUom", ignore = true)
    @Mapping(target = "basicUnit", ignore = true)
    PackingUom mapToEntity(CreatePackingDTO createPackingDTO);

    @Mapping(target = "widthUom", ignore = true)
    @Mapping(target = "weightUom", ignore = true)
    @Mapping(target = "uomId", ignore = true)
    @Mapping(target = "rplLabel", ignore = true)
    @Mapping(target = "qty", ignore = true)
    @Mapping(target = "packMaterial", ignore = true)
    @Mapping(target = "outLabel", ignore = true)
    @Mapping(target = "lengthUom", ignore = true)
    @Mapping(target = "inLabel", ignore = true)
    @Mapping(target = "heightUom", ignore = true)
    @Mapping(target = "cubeUom", ignore = true)
    @Mapping(target = "cartonizeUom", ignore = true)
    @Mapping(target = "bizId", ignore = true)
    @Mapping(target = "basicUnit", ignore = true)
    PackingUom mapToEntity(UpdatePackingDTO updatePackingDTO);

    @Mapping(target = "rplLabel", ignore = true)
    @Mapping(target = "basicUnit", ignore = true)
    PackingUom mapToEntity(PackingUomDTO dto);

    @Mapping(target = "widthUom", ignore = true)
    @Mapping(target = "weightUom", ignore = true)
    @Mapping(target = "uomId", ignore = true)
    @Mapping(target = "qty", ignore = true)
    @Mapping(target = "packMaterial", ignore = true)
    @Mapping(target = "outLabel", ignore = true)
    @Mapping(target = "lengthUom", ignore = true)
    @Mapping(target = "inLabel", ignore = true)
    @Mapping(target = "heightUom", ignore = true)
    @Mapping(target = "cubeUom", ignore = true)
    @Mapping(target = "cartonizeUom", ignore = true)
    @Mapping(target = "bizId", ignore = true)
    @Mapping(target = "basicUom", ignore = true)
    PackingUomDTO mapToDto(UpdatePackingDTO dto);

}
